import java.util.Arrays;

public class BobbleSort {

    public static void bobbleSort(int[] arr){
        for (int i = 0; i < arr.length-1; i++) {
            for (int j = 0; j < arr.length - 1 - i; j++) {
                if (arr[j]<arr[j+1]) {
                    int a=arr[j];
                    arr[j]=arr[j+1];
                    arr[j+1]=a;
                }
            }
        }
    }

    public static void main(String[] args) {
        int[] arr={8,4894,8468,4684,684,68468,4846,4,864,64,64,6,484,6,46,48,4,81,1,2,8,5,484,84,8,48,4};
        bobbleSort(arr);
        System.out.println(Arrays.toString(arr));
    }
}
